﻿<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="ListagemEmpresasConsultas.aspx.cs" Inherits="_ListagemEmpresasConsultas" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.maskedinput-1.1.4.pack.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ctl00_ContentPlaceHolder1_txtDataInicial").mask("99/99/9999");
            $("#ctl00_ContentPlaceHolder1_txtDataFinal").mask("99/99/9999");
        });
    </script>

<style type="text/css">
    table th 
    {
        font-weight: bold;
    }
    th, td 
    {
        font: 12px arial;
        padding: 5px;
    }
    input[type=text]
    {
        padding: 3px;
    }
    .primeiraMaiuscula
    {
        text-transform:capitalize;
    }

</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h1>Consultas por empresa</h1><br />
            <table style="width:100%;">
                <tr>
                    <td align="center" colspan="3">



        <table style="width: 340px;" id="tabelaParametros">
            <tr>
                <td colspan="4" style="background-color:#5D7B9D;color:White;">
                    <strong>PARÂMETROS</strong></td>
            </tr>
            <tr>
                <td>
                <strong>&nbsp;Data inicial:</strong>
                </td>
                <td>
                    <asp:TextBox ID="txtDataInicial" runat="server" Width="70px" MaxLength="10"></asp:TextBox>
                </td>
                <td>
                <strong>Data final:</strong></td>
                <td>
                    <asp:TextBox ID="txtDataFinal" runat="server" Width="70px" MaxLength="10"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="4">
                    <asp:ImageButton ID="btnPesquisar" runat="server" 
                        ImageUrl="../figuras/bPesquisar.gif" onclick="btnPesquisar_Click" />&nbsp;
                    <asp:RequiredFieldValidator ID="RV1" runat="server" 
                        ControlToValidate="txtDataInicial" Display="None" 
                        ErrorMessage="Informe a data inicial"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RV2" runat="server" 
                        ControlToValidate="txtDataFinal" Display="None" 
                        ErrorMessage="Informe a data final"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CV1" runat="server" 
                        ControlToValidate="txtDataInicial" Display="None" 
                        ErrorMessage="Data inicial inválida" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    <asp:CompareValidator ID="CV2" runat="server" ControlToValidate="txtDataFinal" 
                        Display="None" ErrorMessage="Data final inválida" Operator="DataTypeCheck" 
                        Type="Date"></asp:CompareValidator>
                    <asp:ValidationSummary ID="VS1" runat="server" ShowMessageBox="True" 
                        ShowSummary="False" />
                </td>
            </tr>
        </table>




                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="3">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataSourceID="dsListagemConsultas" EnableModelValidation="True" 
                CellPadding="4" ForeColor="#333333" GridLines="None" 
        CssClass="tabela2" Width="480px" onrowdatabound="GridView1_RowDataBound">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:TemplateField HeaderText="Empresa">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("CNPJ") + " - " + Eval("NomeFantasia") %>' Font-Bold="true"></asp:Label><br />
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Endereco") + ", " + Eval("Numero") + " " + Eval("Complemento") + " - " + Eval("Bairro") %>'></asp:Label><br />
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Cidade") + " - " + Eval("CEP") %>'></asp:Label><br />
                            <asp:Label ID="Label4" runat="server" Text='<%# "Fone: (" + Eval("DDDFone") + ") " + Eval("Fone") + " - Email: " + Eval("Email") %>'></asp:Label><br />
                            <asp:Label ID="Label5" runat="server" Text='<%# "Segmento: " + Eval("SegmentoAtuacao") + " - Responsável cad.: " + Eval("ResponsavelCadastro") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle Width="400px" HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="NConsultas" HeaderText="Consultas">
                    <HeaderStyle HorizontalAlign="center" />
                    <ItemStyle Width="80px" HorizontalAlign="Center" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
            <asp:SqlDataSource ID="dsListagemConsultas" runat="server" 
                ConnectionString="<%$ ConnectionStrings:conexao_intranet_ler %>" 
                DataSourceMode="DataReader" 
                
        ProviderName="<%$ ConnectionStrings:conexao_intranet_ler.ProviderName %>"></asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        <asp:ImageButton ID="btnVoltar" runat="server" 
                            ImageUrl="../figuras/bVoltar.gif" PostBackUrl="CandidatoOpcoes.aspx" />
                    </td>
                </tr>
    </table>
</asp:Content>

